import request from '@/axios';

export const getDirList = data => {
  return request({
    url: '/position/direction/list',
    method: 'get',
    data,
  });
};

export const getDirDetail = id => {
  return request({
    url: '/position/direction/detail',
    method: 'get',
    params: {
      id,
    },
  });
};

export const getDirListByInstance = parentPositionId => {
  return request({
    url: '/position/positionInstance/list',
    method: 'get',
    params: {
      parentPositionId,
    },
  });
};

export const removeDir = ids => {
  return request({
    url: '/position/direction/remove',
    method: 'post',
    params: {
      ids,
    },
  });
};

export const addDir = row => {
  return request({
    url: '/position/direction/add',
    method: 'post',
    data: row,
  });
};

export const updateDir = row => {
  return request({
    url: '/position/direction/update',
    method: 'post',
    data: row,
  });
};

export const getTabsTree = () => {
  return request({
    url: '/position/knowledgeClassification/listForPosition',
    method: 'get',
  });
};
